#!/bin/bash
# Script to run the OpenCTI importer

# Change to the directory containing this script
cd "$(dirname "$0")"

# Activate virtual environment if it exists
if [ -d "../../../myenv" ]; then
    source "../../../myenv/bin/activate"
    echo "Virtual environment activated"
fi

# Run the importer with provided arguments
python importer.py "$@"

# Explain how to use if no arguments provided
if [ $# -eq 0 ]; then
    echo "No arguments provided. Example usage:"
    echo "./run_import.sh --mode once --limit 100"
    echo "./run_import.sh --mode daemon --interval 12"
    echo ""
    echo "For more options, run: ./run_import.sh --help"
fi 